<?php

/**
 * Venta form base class.
 *
 * @package    form
 * @subpackage venta
 * @version    SVN: $Id: sfPropelFormGeneratedTemplate.php 8807 2008-05-06 14:12:28Z fabien $
 */
class BaseVentaForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'         => new sfWidgetFormInputHidden(),
      'cliente_id' => new sfWidgetFormPropelSelect(array('model' => 'Cliente', 'add_empty' => true)),
      'subtotal'   => new sfWidgetFormInput(),
      'descuento'  => new sfWidgetFormInput(),
      'total'      => new sfWidgetFormInput(),
      'fecha'      => new sfWidgetFormDateTime(),
      'tipo'       => new sfWidgetFormInput(),
    ));

    $this->setValidators(array(
      'id'         => new sfValidatorPropelChoice(array('model' => 'Venta', 'column' => 'id', 'required' => false)),
      'cliente_id' => new sfValidatorPropelChoice(array('model' => 'Cliente', 'column' => 'id', 'required' => false)),
      'subtotal'   => new sfValidatorNumber(),
      'descuento'  => new sfValidatorNumber(),
      'total'      => new sfValidatorNumber(),
      'fecha'      => new sfValidatorDateTime(),
      'tipo'       => new sfValidatorString(array('required' => false)),
    ));

    $this->widgetSchema->setNameFormat('venta[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'Venta';
  }


}
